﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace MyWords
{
    public class Word
    {
        public string word;
        public string mean;
        public string prop;
        public string wordID;
        public int isM;
        Word()
        {

        }

        public Word(string word,string mean,string prop,string wordID,int isM)
        {
            this.word = word;
            this.mean = mean;
            this.prop = prop;
            this.wordID = wordID;
            this.isM = isM;
        }

        public void doMark()
        {
            if (isM == 0) { 
                isM = 1;
                CurrentUser.sql.InsertValues("myList", new string[] { this.wordID,this.word,this.mean,this.prop,CurrentUser.ID});
            }
            else
            {
                isM = 0;
                
                CurrentUser.sql.DeleteValuesOR("myList", new string[] { "word","userID" }, new string[]{this.word,CurrentUser.ID},new string[] {"=","="});
            }
        }

    }
}
